package
{
	import mx.events.ResizeEvent;
	
	import spark.components.DataGrid;
	
	public class CustomDatagrid extends DataGrid
	{
		public var headerHeight:int=21;
		
		public function CustomDatagrid()
		{
			addEventListener(ResizeEvent.RESIZE,resizeHandler);
			super();
		}
		
		public function resizeHandler(event:ResizeEvent=null):void
		{
			if (!isNaN(this.headerHeight) && !isNaN(this.rowHeight) && !isNaN(this.height))
			{
				this.height = this.headerHeight + (this.rowHeight*Math.floor(((this.height-this.headerHeight)/this.rowHeight)));
			}
		}
	}
}